<?php
/**
 * Conversations - A lightweight BB for Xaraya
 *
 * @package modules
 * @copyright (C) 2003-2006 The Digital Development Foundation.
 * @license GPL {@link http://www.gnu.org/licenses/gpl.html}
 * @link http://www.xaraya.com
 *
 * @subpackage conversations
 * @link http://xaraya.com/index.php/release/760.html
 * @author John Cox
*/

/**
 * Start the tag cloud
 * @author John Cox
 * @author Roger Raymond
 * @author Carl Corliss (help)
 * @author Jo dalle Nogare 
 * @access  public
 * @return  array
*/

function conversations_user_rss()
{
    // If we mark all as read
    if (!xarVarFetch('subs', 'isset', $subs, NULL, XARVAR_DONT_SET)) return;

    // Security Check
    if (!xarSecurityCheck('ViewCon')) return;
    
    // We need to grab our array early since we are going to be doing this on a one by one basis
    $consettings = xarModGetVar('conversations', 'settings');
    if (!empty($consettings)) {
        $settings = unserialize($consettings);
    }

    // Variable Needed for output
    $data               = array();
    $data['uid']        = xarUserGetVar('uid');
    $data['now']        = time();
    $data['timestamp']  = $settings['initial'];
    $data['items']      = array();

    // OK, lets get the cloud
    if (isset($subs)){
        // Just the subscriptions, ma'am
        $tags = xarModAPIFunc('conversations', 'user', 'gettags_byuid', array(
                              'uid' => $data['uid']//,
                              //'status'    => 1 // hmmm.
                              ));
    } else {        
        // Normal View
        $tags = xarModAPIFunc('conversations', 'user', 'gettags', array(
                              'timestamp' => $data['timestamp']//,
                              //'status'    => 1 // hmmm.
                               ));
    }
    
    // Add the array of items to the template variables
    $data['items'] = $tags;

    return $data;
}
?>